package com.lengchangjing.ConstructionalPatterns.PrototypePattern;

public class ConcretePrototypeA implements Cloneable {

    private String field1;
    private int field2;
    private ClassA classA;

    public ConcretePrototypeA shallowClone(){
        try {
            Object obj = super.clone();
            return (ConcretePrototypeA)obj;
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getField1() {
        return field1;
    }

    public void setField1(String field1) {
        this.field1 = field1;
    }

    public ClassA getClassA() {
        return classA;
    }

    public void setClassA(ClassA classA) {
        this.classA = classA;
    }

    public int getField2() {
        return field2;
    }

    public void setField2(int field2) {
        this.field2 = field2;
    }

}
